package Entwickler;

import java.awt.Color;

public class BasicMeshCreator {
	public static Polygon createVectors(){
		Polygon vectors = new Polygon(0, 0, 0);
		Point p1 = new Point(0, 0, 0, vectors);
		Point p2 = new Point(1, 0, 0, vectors);
		p2.color = Color.red;
		Point p3 = new Point(0, 1, 0, vectors);
		p3.color = Color.blue;
		Point p4 = new Point(0, 0, 1, vectors);
		p4.color = Color.green;
		
		vectors.points.add(p1);
		vectors.points.add(p2);
		vectors.points.add(p3);
		vectors.points.add(p4);
		
		int[] l1 = {p1.identifier, p2.identifier};
		int[] l2 = {p1.identifier, p3.identifier};
		int[] l3 = {p1.identifier, p4.identifier};
		
		vectors.lines.add(l1);
		vectors.lines.add(l2);
		vectors.lines.add(l3);
		
		return vectors;
	}
	
	public static Polygon createCube(){
		Polygon cube = new Polygon(0, 0, 0);
		Point p1 = new Point(1, 1, 1, cube);
		Point p2 = new Point(1, 1, -1, cube);
		Point p3 = new Point(1, -1, 1, cube);
		Point p4 = new Point(1, -1, -1, cube);
		Point p5 = new Point(-1, 1, 1, cube);
		Point p6 = new Point(-1, 1, -1, cube);
		Point p7 = new Point(-1, -1, 1, cube);
		Point p8 = new Point(-1, -1, -1, cube);
		cube.points.add(p1);
		cube.points.add(p2);
		cube.points.add(p3);
		cube.points.add(p4);
		cube.points.add(p5);
		cube.points.add(p6);
		cube.points.add(p7);
		cube.points.add(p8);
		int[] l1 = {p1.identifier, p2.identifier};
		int[] l2 = {p1.identifier, p3.identifier};
		int[] l3 = {p1.identifier, p5.identifier};
		int[] l4 = {p2.identifier, p4.identifier};
		int[] l5 = {p2.identifier, p6.identifier};
		int[] l6 = {p3.identifier, p4.identifier};
		int[] l7 = {p3.identifier, p7.identifier};
		int[] l8 = {p4.identifier, p8.identifier};
		int[] l9 = {p5.identifier, p6.identifier};
		int[] l10 = {p5.identifier, p7.identifier};
		int[] l11 = {p6.identifier, p8.identifier};
		int[] l12 = {p7.identifier, p8.identifier};
		cube.lines.add(l1);
		cube.lines.add(l2);
		cube.lines.add(l3);
		cube.lines.add(l4);
		cube.lines.add(l5);
		cube.lines.add(l6);
		cube.lines.add(l7);
		cube.lines.add(l8);
		cube.lines.add(l9);
		cube.lines.add(l10);
		cube.lines.add(l11);
		cube.lines.add(l12);
		return cube;
	}
}
